<?php 
function sendSMS($msg,$sendTo,$key,$iv,$certificate_id){
    
$URL="http://sms.s4.itlinkonline.com/sendSMS.aspx";

$Encryptedtext ="";
$response="";


try
{
    $Encryptedtext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$key,$msg . "&send_to=" . $sendTo ,MCRYPT_MODE_CBC,$iv);
    $Encryptedtext = base64_encode( $Encryptedtext);
}catch (Exception $e){
 // 'Message :' .$e->getMessage();
}



$URL = $URL . "?r=" . $Encryptedtext . "&Id=" . $certificate_id;

try
{
$ch= curl_init();
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$response= curl_exec($ch);
//echo "<pre>"+ $response +"</pre>";
curl_close($ch);
}catch (Exception $e){
 //echo 'Message :' .$e->getMessage();
}
//echo "<br/>";
return $response;//echo "Request Send";
/*
public function decryptmytext()
{
//$iv_utf= mb_convert_encoding($iv,'UTF-8');
$DecryptedText = mcrypt_decrypt((MCRYPT_RIJNDAEL_256,$key,base64_decode($Encryptedtext),MCRYPT_MODE_CBC,$iv);
}



 */

}

?>
